package com.example.demo.mapper;

import com.example.demo.dto.TableFieldDto;
import com.example.demo.util.QueryWrapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author caitao
 * @date 2022/2/23 10:38 上午
 * @Description
 */
public interface BaseMapper {

    void createTable(@Param("tableName")String tableName, @Param("columns") List<TableFieldDto> cloums);

    int insert(@Param("tableName")String tableName,@Param("map") Map<String,Object> map);

    int updateByPrimaryKey(@Param("tableName")String tableName,@Param("map") Map<String,Object> map);

    Map<String,Object> selectOne(@Param("tableName") String tableName, @Param("wrapper")QueryWrapper queryWrapper);

    List<Map<String,Object>> selectList(@Param("tableName")String tableName,@Param("wrapper") QueryWrapper queryWrapper);

    int removeById(@Param("tableName")String tableName,@Param("id")String id);

    int clearTable(@Param("tableName")String tableName);

    int existTable(String tableName);

    int dropTable(@Param("tableName")String tableName);
}
